\(\int \frac {(a+b x^2)^2}{x^4 (c+d x^2)} \, dx\) [176]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 66 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=-\frac {a^2}{3 c x^3}-\frac {a (2 b c-a d)}{c^2 x}+\frac {(b c-a d)^2 \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{5/2} \sqrt {d}} \]

[Out]

-1/3*a^2/c/x^3-a*(-a*d+2*b*c)/c^2/x+(-a*d+b*c)^2*arctan(x*d^(1/2)/c^(1/2))/c^(5/2)/d^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {472, 211} \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=-\frac {a^2}{3 c x^3}+\frac {(b c-a d)^2 \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{5/2} \sqrt {d}}-\frac {a (2 b c-a d)}{c^2 x} \]

[In]

Int[(a + b*x^2)^2/(x^4*(c + d*x^2)),x]

[Out]

-1/3*a^2/(c*x^3) - (a*(2*b*c - a*d))/(c^2*x) + ((b*c - a*d)^2*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(c^(5/2)*Sqrt[d])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 472

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[(e*x)^m*((a + b*x^n)^p/(c + d*x^n)), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {a^2}{c x^4}-\frac {a (-2 b c+a d)}{c^2 x^2}+\frac {(b c-a d)^2}{c^2 \left (c+d x^2\right )}\right ) \, dx \\ & = -\frac {a^2}{3 c x^3}-\frac {a (2 b c-a d)}{c^2 x}+\frac {(b c-a d)^2 \int \frac {1}{c+d x^2} \, dx}{c^2} \\ & = -\frac {a^2}{3 c x^3}-\frac {a (2 b c-a d)}{c^2 x}+\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{5/2} \sqrt {d}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.97 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=-\frac {a^2}{3 c x^3}+\frac {a (-2 b c+a d)}{c^2 x}+\frac {(b c-a d)^2 \arctan \left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{c^{5/2} \sqrt {d}} \]

[In]

Integrate[(a + b*x^2)^2/(x^4*(c + d*x^2)),x]

[Out]

-1/3*a^2/(c*x^3) + (a*(-2*b*c + a*d))/(c^2*x) + ((b*c - a*d)^2*ArcTan[(Sqrt[d]*x)/Sqrt[c]])/(c^(5/2)*Sqrt[d])

Maple [A] (verified)

Time = 2.68 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.03

method result size
default \(-\frac {a^{2}}{3 c \,x^{3}}+\frac {a \left (a d -2 b c \right )}{c^{2} x}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{c^{2} \sqrt {c d}}\) \(68\)
risch \(\frac {\frac {a \left (a d -2 b c \right ) x^{2}}{c^{2}}-\frac {a^{2}}{3 c}}{x^{3}}-\frac {\ln \left (-\sqrt {-c d}\, x +c \right ) a^{2} d^{2}}{2 \sqrt {-c d}\, c^{2}}+\frac {\ln \left (-\sqrt {-c d}\, x +c \right ) a b d}{\sqrt {-c d}\, c}-\frac {\ln \left (-\sqrt {-c d}\, x +c \right ) b^{2}}{2 \sqrt {-c d}}+\frac {\ln \left (-\sqrt {-c d}\, x -c \right ) a^{2} d^{2}}{2 \sqrt {-c d}\, c^{2}}-\frac {\ln \left (-\sqrt {-c d}\, x -c \right ) a b d}{\sqrt {-c d}\, c}+\frac {\ln \left (-\sqrt {-c d}\, x -c \right ) b^{2}}{2 \sqrt {-c d}}\) \(192\)

[In]

int((b*x^2+a)^2/x^4/(d*x^2+c),x,method=_RETURNVERBOSE)

[Out]

-1/3*a^2/c/x^3+a*(a*d-2*b*c)/c^2/x+(a^2*d^2-2*a*b*c*d+b^2*c^2)/c^2/(c*d)^(1/2)*arctan(d*x/(c*d)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 192, normalized size of antiderivative = 2.91 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=\left [-\frac {3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {-c d} x^{3} \log \left (\frac {d x^{2} - 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right ) + 2 \, a^{2} c^{2} d + 6 \, {\left (2 \, a b c^{2} d - a^{2} c d^{2}\right )} x^{2}}{6 \, c^{3} d x^{3}}, \frac {3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {c d} x^{3} \arctan \left (\frac {\sqrt {c d} x}{c}\right ) - a^{2} c^{2} d - 3 \, {\left (2 \, a b c^{2} d - a^{2} c d^{2}\right )} x^{2}}{3 \, c^{3} d x^{3}}\right ] \]

[In]

integrate((b*x^2+a)^2/x^4/(d*x^2+c),x, algorithm="fricas")

[Out]

[-1/6*(3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(-c*d)*x^3*log((d*x^2 - 2*sqrt(-c*d)*x - c)/(d*x^2 + c)) + 2*a^2*
c^2*d + 6*(2*a*b*c^2*d - a^2*c*d^2)*x^2)/(c^3*d*x^3), 1/3*(3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(c*d)*x^3*arc
tan(sqrt(c*d)*x/c) - a^2*c^2*d - 3*(2*a*b*c^2*d - a^2*c*d^2)*x^2)/(c^3*d*x^3)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (56) = 112\).

Time = 0.38 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.61 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=- \frac {\sqrt {- \frac {1}{c^{5} d}} \left (a d - b c\right )^{2} \log {\left (- \frac {c^{3} \sqrt {- \frac {1}{c^{5} d}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {\sqrt {- \frac {1}{c^{5} d}} \left (a d - b c\right )^{2} \log {\left (\frac {c^{3} \sqrt {- \frac {1}{c^{5} d}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {- a^{2} c + x^{2} \cdot \left (3 a^{2} d - 6 a b c\right )}{3 c^{2} x^{3}} \]

[In]

integrate((b*x**2+a)**2/x**4/(d*x**2+c),x)

[Out]

-sqrt(-1/(c**5*d))*(a*d - b*c)**2*log(-c**3*sqrt(-1/(c**5*d))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d + b**2*c**
2) + x)/2 + sqrt(-1/(c**5*d))*(a*d - b*c)**2*log(c**3*sqrt(-1/(c**5*d))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d
+ b**2*c**2) + x)/2 + (-a**2*c + x**2*(3*a**2*d - 6*a*b*c))/(3*c**2*x**3)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.08 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} c^{2}} - \frac {a^{2} c + 3 \, {\left (2 \, a b c - a^{2} d\right )} x^{2}}{3 \, c^{2} x^{3}} \]

[In]

integrate((b*x^2+a)^2/x^4/(d*x^2+c),x, algorithm="maxima")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*c^2) - 1/3*(a^2*c + 3*(2*a*b*c - a^2*d)*x^2)/
(c^2*x^3)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.08 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} c^{2}} - \frac {6 \, a b c x^{2} - 3 \, a^{2} d x^{2} + a^{2} c}{3 \, c^{2} x^{3}} \]

[In]

integrate((b*x^2+a)^2/x^4/(d*x^2+c),x, algorithm="giac")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*c^2) - 1/3*(6*a*b*c*x^2 - 3*a^2*d*x^2 + a^2*c
)/(c^2*x^3)

Mupad [B] (verification not implemented)

Time = 5.31 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.36 \[ \int \frac {\left (a+b x^2\right )^2}{x^4 \left (c+d x^2\right )} \, dx=\frac {a^2\,d}{c^2\,x}-\frac {a^2}{3\,c\,x^3}+\frac {a^2\,d^{3/2}\,\mathrm {atan}\left (\frac {\sqrt {d}\,x}{\sqrt {c}}\right )}{c^{5/2}}+\frac {b^2\,\mathrm {atan}\left (\frac {\sqrt {d}\,x}{\sqrt {c}}\right )}{\sqrt {c}\,\sqrt {d}}-\frac {2\,a\,b}{c\,x}-\frac {2\,a\,b\,\sqrt {d}\,\mathrm {atan}\left (\frac {\sqrt {d}\,x}{\sqrt {c}}\right )}{c^{3/2}} \]

[In]

int((a + b*x^2)^2/(x^4*(c + d*x^2)),x)

[Out]

(a^2*d)/(c^2*x) - a^2/(3*c*x^3) + (a^2*d^(3/2)*atan((d^(1/2)*x)/c^(1/2)))/c^(5/2) + (b^2*atan((d^(1/2)*x)/c^(1
/2)))/(c^(1/2)*d^(1/2)) - (2*a*b)/(c*x) - (2*a*b*d^(1/2)*atan((d^(1/2)*x)/c^(1/2)))/c^(3/2)